using System;

namespace ERP_SaaS_WinForm.物料管理.Material
{
    /// <summary>
    /// 物料领用数据传输对象
    /// </summary>
    public class MaterialPickDto : MaterialInfoDto
    {
        /// <summary>
        /// 领用数量
        /// </summary>
        public int pickQuantity { get; set; } = 1;

        /// <summary>
        /// 从MaterialInfoDto创建MaterialPickDto
        /// </summary>
        /// <param name="material">原始物料信息</param>
        /// <returns>新的领用物料对象</returns>
        public static MaterialPickDto FromMaterialInfo(MaterialInfoDto material)
        {
            return new MaterialPickDto
            {
                materialCode = material.materialCode,
                materialName = material.materialName,
                specification = material.specification,
                unit = material.unit,
                attribute = material.attribute,
                inventorylimit = material.inventorylimit,
                inventorylevel = material.inventorylevel,
                currentInventory = material.currentInventory,
                warehouseCode = material.warehouseCode,
                purchasePrice = material.purchasePrice,
                periodOfValidity = material.periodOfValidity,
                materialState = material.materialState,
                pickQuantity = 1 // 默认领用数量为1
            };
        }
    }
} 